package cn.crawler.app.crown.modules.models;

import cn.crawler.app.crown.modules.models.enums.BetsEnum;
import cn.crawler.framework.base.model.BaseModel;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;

import java.io.Serializable;
import java.math.BigDecimal;


/**
 * 投资玩法
 */
@Data
//@TableMeta("{'mysql-engine':'myisam'}")
@Table("crown_bet")
@TableIndexes({@Index(name = "INDEX_MATCHID_TYPE_BETCONTENT", unique = false, fields = {"matchId","type","betContent"})})
public class CrownBet extends BaseModel implements Serializable {
    @Column
    @Name
    @Comment("ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @PrevInsert(els = {@EL("uuid()")})
    private String id;


    @Column
    @Comment("赛事ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String matchId;


    @Column
    @Comment("玩法类型:半场波胆:HALF_PD、全场波胆:FULL_PD、全场总入球:FULL_GOALS")
    @ColDefine(type = ColType.VARCHAR, width = 10)
    private BetsEnum type;


    @Column
    @Comment("投注内容")
    @ColDefine(type = ColType.VARCHAR, width = 8)
    private String betContent;


    @Column
    @Comment("赔率")
    @ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
    private BigDecimal rate;


    @Column
    @Comment("招募金额")
    @ColDefine(type = ColType.FLOAT, width = 16, precision = 6)
    private BigDecimal recruitAmount;


    @Column
    @Comment("已完成金额")
    @ColDefine(type = ColType.FLOAT, width = 16, precision = 6)
    @Default(value = "0")
    private BigDecimal completedAmount;

    /**
     *
     */
    private BigDecimal quota;

}
